<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel="stylesheet" href="<?=PATH_URL?>static/css/admin/xekhach.css" type="text/css">
	<style>
	*{
		margin: 0;
		outline: 0 none;
	}

	html, body {
		margin: 0;
		padding: 0;
	}

	</style>
	<script>
	function init(){
		// window.print();
	}
	</script>
</head>
<body onload="init()" >
<div class="thongkedoanhthu">
	<div class="title">CTY TNHH SX TM DV THIÊN PHÁT ĐẠT - CHI NHÁNH TÂN PHÚ</div>
	<div class="diachi">Địa chỉ : Phú Thanh - Tân Phú - Đồng Nai. Số ĐT: 0613696999 - 0613795555</div>
	<div class="thongkedoanhthu">Thống kê doanh thu theo ngày</div>
	<table>
		<tr>
			<td class="tb_header" style="width:50px;" >Stt</td>
			<td class="tb_header" >Ngày</td>
			<td class="tb_header" >Xe</td>			
			<td class="tb_header" >Tiền xe Ôm</td>
			<td class="tb_header" >Chi dầu</td>
			<td class="tb_header" >Chi tài</td>
			<td class="tb_header" >Chi ngoài</td>			
			<td class="tb_header" >Quỹ tài xế</td>			
			<td class="tb_header" >Góp thế chân</td>
			<td class="tb_header" >Lương tài xế</td>
			<td class="tb_header" >Còn lại</td>									
		</tr>
		<?php
		if(!empty($phieu_tinh_tien_list)){
			$i = 1;
			$total_chi_xeom = 0;
			$total_chi_dau = 0;
			$total_chi_tai = 0;
			$total_chi_ngoai = 0;
			$total_quy_tai_xe = 0;
			$total_gop_the_chan = 0;
			$total_tien_tra_tai_xe = 0;
			$total_con_lai = 0;
			foreach($phieu_tinh_tien_list as $phieu_tinh_tien){
				$chi_xeom = $phieu_tinh_tien['chi_xeom'];
				$total_chi_xeom += $chi_xeom;
				
				$chi_dau = $phieu_tinh_tien['chi_dau'];
				$total_chi_dau += $chi_dau;
				
				$chi_tai = $phieu_tinh_tien['chi_tai'];
				$total_chi_tai += $chi_tai;
				
				$chi_ngoai = $phieu_tinh_tien['chi_ngoai'];
				$total_chi_ngoai += $chi_ngoai;
				
				$quy_tai_xe = $phieu_tinh_tien['quy_tai_xe'];
				$total_quy_tai_xe += $quy_tai_xe;
				
				$gop_the_chan = $phieu_tinh_tien['gop_the_chan'];
				$total_gop_the_chan += $gop_the_chan;
				
				$tien_tra_tai_xe = $phieu_tinh_tien['tien_tra_tai_xe'];
				$total_tien_tra_tai_xe += $tien_tra_tai_xe;
				
				$con_lai = $phieu_tinh_tien['con_lai'];
				$total_con_lai += $con_lai;
		?>
		<tr>
			<td  class="tb_content"><?=pad_number($i)?></td>
			<td  class="tb_content"><?=$phieu_tinh_tien['departure_date']?></td>
			<td  class="tb_content"><?=$phieu_tinh_tien['vehicle_number']?></td>
			<td  class="tb_content"><?=$chi_xeom?></td>
			<td  class="tb_content"><?=$chi_dau?></td>
			<td  class="tb_content"><?=$chi_tai?></td>		
			<td  class="tb_content"><?=$chi_ngoai?></td>
			<td  class="tb_content"><?=$quy_tai_xe?></td>
			<td  class="tb_content"><?=$gop_the_chan?></td>
			<td  class="tb_content"><?=$tien_tra_tai_xe?></td>
			<td  class="tb_content"><?=$con_lai?></td>		
		</tr>
		<?php
				$i++;
			}
		?>
		<tr>
			<td  class="tb_content" colspan="3">Tổng doanh thu:</td>
			<td  class="tb_content"><?=$total_chi_xeom?></td>
			<td  class="tb_content"><?=$total_chi_dau?></td>
			<td  class="tb_content"><?=$total_chi_tai?></td>		
			<td  class="tb_content"><?=$total_chi_ngoai?></td>
			<td  class="tb_content"><?=$total_quy_tai_xe?></td>
			<td  class="tb_content"><?=$total_gop_the_chan?></td>
			<td  class="tb_content"><?=$total_tien_tra_tai_xe?></td>
			<td  class="tb_content"><?=$total_con_lai?></td>
		</tr>
		<?php
		}
		?>
	</table>
</div>
</body>
</html>
